Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
Path scope:
|
| ignore_globs=ignore, | ||
| include_globs=include, | ||
| smoke_job=smoke_job, | ||
| old_heavy_prefix="Accuracy (", |
There was a problem hiding this comment.
atom-test heavy job is named exactly Accuracy, not Accuracy (, so _proves_pass never matches it. make prefix per-suite, and have tests read the name: from each workflow instead of the constant.
| jobs: | ||
| dispatch-authorization: | ||
| if: ${{ github.event_name == 'workflow_dispatch' }} | ||
| uses: ./.github/workflows/dispatch-authorization.yaml |
There was a problem hiding this comment.
local reusable workflow resolves from the dispatched ref, so a write user can just drop the needs/if on their branch. this is an accidental-dispatch guard, not a security boundary, say so in the header. applies to all 15 callers.
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| # Also gates atom-release-automation's manual runs: a called workflow sees |
There was a problem hiding this comment.
only the build job is covered, atom-release-automation's own prepare still pushes refs before auth. add the guard there too, or narrow the comment and description.
…d runners Any user with write access could dispatch a workflow that takes GPU or build runners, on any branch. Now a manual run of such a workflow first checks that the user who triggered it has the maintain or admin role on the repository, and stops before any self-hosted runner is taken otherwise. The check is one canonical step (.github/scripts/authorize_dispatch_step.yaml), the first step of every root job, run only on workflow_dispatch; it adds no job, so the job graph and the old gate's view of it are unchanged. A root job must run on a GitHub-hosted runner, so atom-release and the SGLang / vLLM accuracy validations, whose first jobs take self-hosted runners, get an `authorize` job ahead of them. tests/test_ci_dispatch_authorization.py makes this an invariant instead of a list: every workflow that can be dispatched and reaches a runner that is not GitHub-hosted (directly or through a workflow it calls) must start each root job, on a GitHub-hosted runner, with exactly that step. It found atomrl-unit-tests and atom-release-automation, which a hand list had missed. The role lookup works with an empty-permission token (Metadata: read), checked on a throwaway branch.
06682f3 to
06d348e
Compare
06d348e to
bb752ba
Compare
| # result. tests/test_ci_gate_suites.py derives the required part | ||
| # from pyproject.toml and this file and checks it is covered. | ||
| CI_GATE_PATHS_INCLUDE: | | ||
| atom/** |
There was a problem hiding this comment.
atom_test.sh runs scripts/wait_infer_drain.sh, so a change to it now skips the whole GPU suite. add it here and in ci_gate/suites.py, and let the relevance test follow non-.github paths?
bb752ba to
681bf33
Compare
The heavy-CI gate today infers from each event whether heavy CI should run, and its required check can be green on a commit heavy CI never ran on (an unapproved PR, a stacked PR later retargeted onto main, an approval before its run starts). The CI Evaluator (ci-evaluator.yaml, code in .github/scripts/ci_gate) decides from the PR's current state, read from the API, and writes one commit Status per suite on the head commit. It is success only when a run that speaks for the head proved heavy CI on it, or the change needs no suite run. Each notion is defined once: - a run speaks for the head when it is a PR event (pull_request or pull_request_review) of the head commit and, if the base ever changed, created after the last change (GitHub's times are to the second); a manual dispatch never does, and the commit, not the repository a run reports, identifies the code; - a run's latest attempt passed heavy CI, failed it, or proves nothing (running, waiting for a fork approval, cancelled, heavy CI not run); a run of the pre-cutover workflow passed when its signal job and its gate job both succeeded. Any passing run is the proof; any run still going is waited for; else the latest failing run decides; - a PR that changes a path its suite's run executes outside the product code (PRODUCT_DIRS) changes that run's definition: its own run's pass counts once the PR has an approved review; - changed paths include both sides of a rename, and a cut-short file list rules nothing out; - PR references (#N, owner/repo#N, the PR URL) are parsed in one place; dependencies are the references after "Depends on", "Stacked on" or "Blocked by" to the end of that paragraph (or in the next, when it ends at the keyword), however decorated, every one checked; they hold the PR while they are open PRs here; - the GitHub client classifies every call: a fact (a 404 or GraphQL NOT_FOUND included), transient (network, 5xx, rate limits: a 403 / 429, or a GraphQL error in a 200; retried as GitHub says), or an error. Each PR is evaluated in its own job, in a concurrency group of that PR, from pull_request_target events, suite-workflow and review-relay (ci-review-relay.yaml) completions, by hand (an ASCII PR number), and every 10 minutes over every open non-draft PR, whatever its base: those with no Status first, the other slots rotating through the rest by the pass's time slot, so every PR is reached with no state kept. A Status depends on what the PR list does not show, so after a lost event any may be out of date. A failed evaluation shows as error on its PR, never over a success. Shadow phase: the Statuses are marked [preview] and are not required; re-runs, cancels and dependency holds are only listed in the job summary next to the old gate's result. The old gate still decides what runs. The README lists what the design assumes of GitHub, each checked against the documentation or live data, what a cutover needs first (a GitHub App as the Status's only source), and the boundaries left on purpose. tests/ci_gate_sim.py simulates the protocol under every combination of the GitHub behaviours the design does not rely on; each of its six defences is shown necessary by removing it.
ATOM Test decided relevance by a deny-list: every path not listed ran the GPU suite, so a PR changing only a CPU unit test (#3879) ran 15 GPU jobs. The plugin and ATOMesh suites had the opposite gap: their include lists missed files their PR runs execute (the gate's own action and scripts, shared download and supervision scripts, setup.py and the README pyproject.toml installs with), so a change to those ran none. A change is relevant to a suite when it can alter what the suite's PR run executes. Of the product code each suite takes what it tests: ATOM Test all of atom/ but the plugins and ATOMesh, the plugin and ATOMesh suites atom/plugin/** and atom/mesh/**, the rest left to ATOM Test and the runs on main. Which other files a run executes cannot be proven from the repository's text (a run may compute a name), so the lists err on the side of running: every area a PR run may execute (RUN_AREAS: the packaging files and readme, scripts/, docker/, the CI's scripts, actions and data) counts for every suite, with the suite's own workflow and those its run reads; a suite leaves a path out only by a reviewed ignore entry. Other workflows, CPU unit tests, docs, tools, recipes and atomrl/ start no suite. Over the last 150 merged PRs this runs each suite for a few more than an exact list would (ATOM Test 117 of 150). tests/test_ci_gate_suites.py holds this together: every file git tracks is classified once (product, run area, workflow, or not run, with why); what tests/ci_gate_relevance.py can derive of each run (the files its PR-run steps name, from the repository root wherever it is mounted or from the naming file's directory, followed through the scripts, Dockerfiles and actions it executes) must be covered by the suite's list and never classified as not run; the four workflows' gate lists equal ci_gate/suites.py. The old gate (check_heavy_ci_gate.sh) now reads both sides of a rename and rules nothing out from a file list GitHub may have cut short, as the evaluator does: with an include list, a file moved out of atom/ would otherwise run nothing. .github/CODEOWNERS covers the repository, owners to be filled in: main's ruleset already requires a code owner's review, which then makes an approval that authorizes heavy CI one an owner gave.
681bf33 to
6052350
Compare
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
please re-run the non-GPU unit tests with logs kept, and the smoke job too..
ci Run non-GPU unit tests failed — not sure yet (medium): Log is empty (0 bytes) and no infra hint matches, so the cause cannot be read; this PR adds several new CPU tests and touches .github scripts, while the same job succeeded in the last 7 runs on main and 7 other recent runs.
log .valar/ci/job_140556095797.log is 0 bytes
same job on main: 2026-11-27T13:44 success, 13:29 success, 11:03 success, 10:25 success, 10:12 success, 09:55 success, 08:20 success
next: Re-run the job with logs retained; if pytest fails, it is almost certainly a new test in this PR (tests/test_ci_gate_*.py, tests/ci_gate_relevance.py) and must be fixed here. https://github.com/ROCm/ATOM/actions/runs/46013920213/job/140556095797
ci Offline inference smoke test failed — not sure yet (low): Log is empty (0 bytes), so neither a PR bug nor a runner/GPU fault can be excluded; the PR changes no atom/ product code, which makes a genuine inference regression unlikely, and the same job passed once recently.
log .valar/ci/job_140556285507.log is 0 bytes
same job on other recent runs: {'success': 1}
next: Re-run the smoke job and keep its log; treat as infra until the log shows otherwise. https://github.com/ROCm/ATOM/actions/runs/46013920297/job/140556285507
ci ATOM Test Gate failed — not sure yet (medium): This gate job consumes the 'Offline inference smoke test' result (optional-results: offline-smoke-test=...) and failed because that job failed; it is a cascade, not an independent failure, and the upstream log is empty.
log .valar/ci/job_140562343486.log is 0 bytes
job depends on optional-results: offline-smoke-test=...
next: No action on the gate itself; re-run it after the smoke job passes. https://github.com/ROCm/ATOM/actions/runs/46013920297/job/140562343486
Summary
Three changes to how heavy CI is allowed to run, one commit each.
1. Only maintainers can manually run workflows that reach self-hosted runners
Any user with write access can dispatch a workflow that takes GPU or build runners, on any branch (for example, the full
ATOM Testaccuracy matrix dispatched repeatedly on personal branches). Now a manual run first checks that the user who triggered it has the maintain or admin role on the repository, and stops before any self-hosted runner is taken otherwise, asking for a maintainer to trigger it. Runs that are not manual are unchanged..github/scripts/authorize_dispatch_step.yaml), the first step of every root job, run only onworkflow_dispatch. It adds no job, so the job graph (and the old gate's reading of it) is unchanged.atom-releaseand the SGLang / vLLM accuracy validations, whose first jobs take self-hosted runners, get a GitHub-hostedauthorizejob ahead of them.tests/test_ci_dispatch_authorization.pymakes coverage an invariant rather than a list: every dispatchable workflow that reaches a non-GitHub-hosted runner (directly or through a workflow it calls) must start each root job, on a GitHub-hosted runner, with exactly that step. It covers 16 workflows today and fails on any new one added without the step.2. Heavy-CI evaluator, shadow mode
The current gate infers from each event whether heavy CI should run, and its required check can be green on a commit heavy CI never ran on: an unapproved PR, a stacked PR later retargeted onto
main(its last result stays), the window between an approval and its run. A PR that depends on another open PR also gets full heavy CI.The CI Evaluator (
ci-evaluator.yaml, code in.github/scripts/ci_gate/, see itsREADME.md) decides from the PR's current state read from the API and writes one commit Status per suite (ATOM Test Status,ATOM SGLang Test Status,ATOM vLLM Test Status,ATOMesh Accuracy Status) on the head commit. It is success only when a run that speaks for the head proved heavy CI on it, or the change needs no suite run. Each notion is defined once:pull_request,pull_request_review) of the head commit and, if the base ever changed, created after the last change (GitHub's times are to the second); a manual dispatch never does;Depends on/Stacked on/Blocked byto the end of that paragraph (or in the next, afterDepends on:), however decorated, every one checked; they hold the PR while they are open PRs here;NOT_FOUND), transient (network, 5xx, rate limits: a 403 / 429, or a GraphQL error in a 200; retried as GitHub says), or an error.Each PR is evaluated in its own job, in a concurrency group of that PR; triggers are
pull_request_targetevents, suite-workflow and review-relay (ci-review-relay.yaml) completions, a manual run (an ASCII PR number), and a pass every 10 minutes over every open non-draft PR: those with no Status first, the other slots rotating through the rest, so every PR is reached with no state kept between passes (about 15 API calls a PR; ROCm'sGITHUB_TOKENallows 15,000 an hour). A failed evaluation shows aserroron its PR, never over a success.The README lists what the design assumes of GitHub, each checked against the documentation or live data (second-precision times, re-runs keeping their
created_at,reviewDecisionon open PRs, rate-limit signals, file and status limits, …), what a cutover needs first, and the boundaries left on purpose (runs matched to a PR by commit; ATOM vLLM Test's run installing the PR's head rather than its merge intomain; the plugin and ATOMesh suites testing only their own code).This PR only turns it on in shadow mode: the Statuses are marked
[preview]and are not required; the re-runs, cancels and dependency holds a decision would take are only listed in the job summary next to the old gate's result. The old gate still decides what runs; themainruleset is unchanged. Before any cutover, a required Status must be one nobody else can write: anyone with write access, or a workflow a PR adds, can post a Status as GitHub Actions, so the evaluator must write as a GitHub App of its own and the ruleset require that source; the repository's default workflow permissions must go to read and "Allow GitHub Actions to approve pull requests" off; and.github/CODEOWNERSmust name its owners.3. Each heavy suite runs for every change its PR run can execute
ATOM Test's gate decided relevance by a deny-list: every path not listed ran the GPU suite, so a PR changing only a CPU unit test (#3879) ran 15 GPU jobs. The plugin and ATOMesh suites had the opposite gap: their include lists missed files their PR runs execute, so a change to those ran none of them.
A change is relevant to a suite when it can alter what the suite's PR run executes. Of the product code each suite takes what it tests (ATOM Test all of
atom/but the plugins and ATOMesh; the plugin and ATOMesh suitesatom/plugin/**andatom/mesh/**). Which other files a run executes cannot be proven from the repository's text (a run may compute a name), so the lists err on the side of running: every area a PR run may execute (RUN_AREAS: the packaging files and the READMEpyproject.tomlinstalls with,scripts/,docker/, the CI's scripts, actions and data) counts for every suite, with the suite's own workflow; a path is left out only by a reviewed ignore entry. Other workflows, CPU unit tests, docs, tools, recipes andatomrl/start no suite. Over the last 150 merged PRs: ATOM Test 117, SGLang 25, vLLM 24, ATOMesh 26. This changes the old gate immediately.tests/test_ci_gate_suites.py: every file git tracks is classified once (product, run area, workflow, or not run, with why); whattests/ci_gate_relevance.pycan derive of each run (files its PR-run steps name, from the repository root wherever it is mounted or from the naming file's directory, followed through the scripts, Dockerfiles and actions it executes) must be covered by the suite's list and never classified as not run; the workflows' gate lists equalci_gate/suites.py.check_heavy_ci_gate.sh) now reads both sides of a rename and rules nothing out from a file list GitHub may have cut short, as the evaluator does (with an include list, a file moved out ofatom/would otherwise run nothing)..github/CODEOWNERScovers the repository, owners to be filled in:main's ruleset already requires a code owner's review, which then makes an approval that authorizes heavy CI one an owner gave. Until owners are named it has no effect.Test plan
tests/test_ci_gate_*.py,tests/test_ci_dispatch_authorization.pyandtests/test_heavy_ci_gate.py(needsjq): 369 tests, none skipped; commit 2 alone passes its own 293.tests/ci_gate_sim.py: protocol simulator over every combination of the GitHub behaviours the design does not rely on, times to the second: 64,000 random event sequences, no violation of "success only on a proved commit". Removing each of its six defences (aggregate checks its needs, merge-base check, base-change time rule, manual runs don't count, incomplete file lists rule nothing out, a self-changed CI definition needs an approved review) produces violations.ci-sandbox/*branches (re-runs byGITHUB_TOKEN, re-run vs concurrency,pull_request_targetusing the default branch's file, the role lookup with an empty-permission token).CI_GATE_DRY_RUN=1): verdicts match what the runs show (e.g. [Sgl Atom][test] Check GDN forward-context step ownership #3774, changing only the SGLang plugin and its unit test, no longer needs ATOM Test, where the old gate failed it; a draft gets no Status).CI Evaluatorruns succeed and[preview]Statuses appear on open PRs.Authorize manual run; one by a maintainer runs.